package org.yu.team2023.flashdays;

import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.damagesource.DamageType;

public class ModDamageTypes {
    public static final ResourceKey<DamageType> REFLEXIVE =ResourceKey.create(Registries.DAMAGE_TYPE,new ResourceLocation(FlashDays.MODID,"reflexive"));
    public static final ResourceKey<DamageType> BLEED =ResourceKey.create(Registries.DAMAGE_TYPE,new ResourceLocation(FlashDays.MODID,"bleed"));
    public static final ResourceKey<DamageType> ADDITION_ATTACK =ResourceKey.create(Registries.DAMAGE_TYPE,new ResourceLocation(FlashDays.MODID,"addition_attack"));

    public static int getDamageColor(String msgId) {
        if (msgId.contains("bypass_magic")) {
            return 0x07AC5CD;
        }
        if(msgId.contains("bypass_armor"))
            return 0xFFEFD5;
        if(msgId.contains("magic")){
            return 0x00FFFF;
        }
        return switch (msgId) {
            case  "inFire", "lava", "onFire", "hotFloor", "dryout", "explosion" -> 0xFF3030;
            case  "sweetBerryBush" -> 0x228B22;
            case  "wither", "freeze", "dragonBreath" -> 0x4169E1;
            case "flashdays.Bleed", "anvil", "generic" -> 0xFFD700;
            case "flashdays.Reflexive", "inWall", "flyIntoWall", "fall", "fallingBlock" -> 0xFFFFE0;
            case "heal"->0x00FF00;
            case "flashdays.AdditionAttack"->0xeb2db0;
            default -> 0xffffff;
        };
    }
}
